import Ember from 'ember';
import config from './config/environment';

var Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
  this.route("keypairs", function() {});
  this.route("people", function(){
    this.route("edit", {path: '/edit/:id'});
    this.route('new');
  });
  this.route('accessdeny');
  this.route('mconsole', function() {
    this.route("working-workers");
    this.route('reporting');
  });
  this.route('login');
  this.route('trees', function() {
    this.route('edit', {path: '/edit/:id'});
    this.route('new');
  });
  this.route('treenodes', function() {
    this.route('index', {path: '/:id'}, function(){
      this.route("children", {path: '/:nid'});
      this.route("new", {path: '/:nid/new'});
      this.route("edit", {path: '/edit/:nid'});
    });
  });
  this.route('learning', function(){
    this.route('index', {path: '/:id1/:id2'}, function() { //index route got params: id1,id2,not id3
      this.route('another', {path: '/:id3'}); //another route got id3,not id1 and id2.
    });
  });
});

export default Router;
